import { type ComponentConfigModel } from '/@/views/formDesigner/utils';
export default {
  component: () => import('ant-design-vue/lib/checkbox'),
  defaultSchema: {
    label: '复选框',
    type: 'checkbox',
    icon: 'epic-icon-duoxuan1',
    field: 'checkbox',
    input: true,
    componentProps: {},
  },
  config: {
    attribute: [
      {
        label: '控件字段',
        type: 'input',
        field: 'name',
        componentProps: {
          placeholder: '必填项',
          require: true,
        },
      },
      {
        label: '控件名称',
        type: 'input',
        field: 'title',
        componentProps: {
          placeholder: '必填项',
          require: true,
        },
      },
      {
        label: '标签名称',
        type: 'input',
        field: 'label',
        componentProps: {
          placeholder: '必填项',
          require: true,
        },
      },
      {
        label: '选中状态',
        type: 'radio',
        field: 'checked',
        componentProps: {
          defaultValue: false,
          options: [
            {
              label: '不选中',
              value: false,
            },
            {
              label: '选中',
              value: true,
            },
          ],
        },
      },
      {
        label: '组名',
        type: 'input',
        field: 'description',
        componentProps: {
          placeholder: '',
        },
      },
      {
        label: '值为0时的显示',
        type: 'input',
        field: 'present0',
      },
      {
        label: '值为1时的显示',
        type: 'input',
        field: 'present1',
      },
      {
        label: '显示',
        type: 'switch',
        field: 'isShow',
        componentProps: {
          defaultValue: true,
          checkedValue: true,
          unCheckedValue: false,
        },
      },
      {
        label: '只读',
        type: 'switch',
        field: 'isReadOnly',
      },
      {
        label: '只读类型',
        describe: '仅编辑引用记录时适用于”嵌套表格2“宏控件选取的记录',
        type: 'select',
        componentProps: {
          placeholder: '请选择',
          allowClear: true,
          defaultValue: '',
          options: [
            {
              label: '不限',
              value: '',
            },
            {
              label: '仅添加时',
              value: '0',
            },
            {
              label: '仅编辑时',
              value: '1',
            },
            {
              label: '仅编辑引用记录时',
              value: '2',
            },
          ],
        },
        field: 'readOnlyType',
      },
      {
        label: '提示',
        type: 'textarea',
        field: 'tip',
      },
      {
        label: '开关',
        type: 'radio',
        field: 'switch',
        componentProps: {
          defaultValue: false,
          options: [
            {
              label: '否',
              value: false,
            },
            {
              label: '是',
              value: true,
            },
          ],
        },
      },
    ],
    event: [
      {
        type: 'change',
        describe: '值变化时',
      },
    ],
  },
  bindModel: 'checked',
} as ComponentConfigModel;
